package com.suneee.base.context;

import java.io.Serializable;
import java.sql.Timestamp;

import com.suneee.base.entity.DeviceType;
import com.suneee.sso.admin.entity.Administrator;

@SuppressWarnings("serial")
public class OnlineUser implements Serializable{

	/**
     * session Id(登陆唯一标示)
     */
    private String sessionId;

    /**
     * 登录用户
     */
    private Administrator admin;
    
    /**
     * 登录用户登录时间
     */
    private Timestamp loginTime;

    /**
     * 登录用户登陆方式
     */
    private DeviceType deviceType;

    /**
     * 最后一次访问时间
     */
    private Timestamp lastVisitedTime;
    
    /**
     * 登录用户IP
     */
    private String ip;
    
    /**
     * 是否token请求
     */
    private boolean tokenRequest;
    
    public OnlineUser(){
        
    }

    public OnlineUser(String sessionId, Administrator admin, Timestamp loginTime, String ip, DeviceType deviceType){
        this.sessionId = sessionId;
        this.admin = admin;
        this.loginTime= loginTime;
        this.lastVisitedTime = loginTime;
        this.deviceType = deviceType;
        this.ip = ip;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }


    public Timestamp getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Timestamp loginTime) {
        this.loginTime = loginTime;
    }

    public DeviceType getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(DeviceType deviceType) {
        this.deviceType = deviceType;
    }

    public Timestamp getLastVisitedTime() {
        return lastVisitedTime;
    }

    public void setLastVisitedTime(Timestamp lastVisitedTime) {
        this.lastVisitedTime = lastVisitedTime;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

	public boolean isTokenRequest() {
		return tokenRequest;
	}

	public void setTokenRequest(boolean tokenRequest) {
		this.tokenRequest = tokenRequest;
	}

	public Administrator getAdmin() {
		return admin;
	}

	public void setAdmin(Administrator admin) {
		this.admin = admin;
	}
}
